<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input type="text" v-model="value">

</div>
<script src="../vue.js"></script>
<script>
    //vue2 主要是用 definePeoperty,没有办法监听对象的属性
    //vue3 proxy 这个可以

    console.log(window);
    var arr = [{value:123},{value2:456}];
    localStorage.setItem('yateng',JSON.stringify(arr));//转成字符串
    let res = JSON.parse(localStorage.getItem('tateng'));//转成引用类型（数组或对象）
    console.log(res);

    new Vue({
        el:'#app',
        data(){
            return{}
        },
        computed:{
            value :{
                get(){
                    console.log('get');
                },
                set(val){
                    console.log(val)
                }
             }
        }
    })
</script>
</body>
</html>